#!/usr/bin/ruby -w

class String
	def compound(divs, diff)
		out = ""
		if divs >= 2 
			res,rem = diff.divmod(divs)
			out << ">"
			out << "+" * res.abs
			body = "-" * divs
			body = "+" * divs if diff < 0
			out << "[<#{body}>-]<"
		else
			rem = diff
		end	
		out << simple(rem)
		out
	end

	def simple(diff)
		out = ""
		if diff > 0
			out << "-" * diff
		elsif diff < 0
			out << "+" * diff.abs
		end
		out
	end

	def to_bf(simple = false)
		out = ">[-]"
		val = 0
		self.each_byte do |b|
			diff = val - b
			if simple
				out << simple( diff )
			else
				res =[1,2,3,4,5,6,7,8,9,10].collect { |x| compound(x, diff) }
				res = res.sort_by { |w| w.size }
				out << res[0]
			end
			out << '.'
			val = b
		end
		out
	end
end

if ARGV.size == 1
	puts ARGV[0].to_bf( true )
else
	STDIN.each_line { |line| puts line.to_bf(false) }
end
